package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

/**
 * 邮件实体对象
 */
@TableName("t_mail")
public class MailBean {
    /**
     * 邮件id
     */
    @TableId(value = "pk_mailId", type = IdType.AUTO)
    private Integer mailId;
    /**
     * 邮件主题
     */
    @TableField("m_subject")
    private String subject;
    /**
     * 邮件内容
     */
    @TableField("m_content")
    private String content;
    /**
     * 邮件附件
     */
    @TableField("m_annex")
    private String annex;
    /**
     * 日期
     */
    @TableField("m_date")
    private LocalDate date = LocalDate.now();
    /**
     * 发件人对象
     */
    @TableField(exist = false)
    private EmployeeBean sender;
    /**
     * 发件人id
     */
    @TableField("fk_senderId")
    private Integer senderId;
    /**
     * 邮件是否有效
     */
    @TableField("m_status")
    private String emStatus = "有效";
    /**
     * 收件人(“字符串拼接”)
     */
    @TableField("m_receiver")
    private String receiver;

    public MailBean() {
    }

    public MailBean(String subject, String content, String annex, Integer senderId, String receiver) {
        this.subject = subject;
        this.content = content;
        this.annex = annex;
        this.senderId = senderId;
        this.receiver = receiver;
    }

    public Integer getMailId() {
        return mailId;
    }

    public void setMailId(Integer mailId) {
        this.mailId = mailId;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAnnex() {
        return annex;
    }

    public void setAnnex(String annex) {
        this.annex = annex;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public EmployeeBean getSender() {
        return sender;
    }

    public void setSender(EmployeeBean sender) {
        this.sender = sender;
    }

    public Integer getSenderId() {
        return senderId;
    }

    public void setSenderId (Integer senderId ) {
        this.senderId = senderId ;
    }

    public String getEmStatus() {
        return emStatus;
    }

    public void setEmStatus(String emStatus) {
        this.emStatus = emStatus;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver =receiver;
    }

    @Override
    public String toString() {
        return "MailBean{" +
                "mailId=" + mailId +
                ", subject='" + subject + '\'' +
                ", content='" + content + '\'' +
                ", annex='" + annex + '\'' +
                ", date=" + date +
                ", sender=" + sender +
                ", senderId=" + senderId +
                ", emStatus='" + emStatus + '\'' +
                ", receiver='" + receiver + '\'' +
                '}' + "\n";
    }
}